﻿// utf8-BOM模板
#ifndef _OI_DEFINITION_TEMPL_DLG_HPP_
#define _OI_DEFINITION_TEMPL_DLG_HPP_

#include "PLScannerCore/OiPLScannerCore.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class DefinitionTemplDlg :public QDialog
        {
            Q_OBJECT
        public:
            DefinitionTemplDlg(DefinitionType dt, QWidget* parent = nullptr);
            ~DefinitionTemplDlg();

            void onConfirm();
            void onCancel();

        public:
            void setParams(const ProductParams& params);
            const ProductParams& params();

        private:
            OI_DISABLE_COPY(DefinitionTemplDlg);
            OI_DECLARE_IMPL(DefinitionTemplDlg);
        };

        class TemplInputWidget :public QWidget
        {
            Q_OBJECT
        public:
            TemplInputWidget(DefinitionType dt, QWidget* parent = nullptr);
            virtual ~TemplInputWidget();

        public:
            virtual QList<DefinitionPoint> definitionPoints();
            virtual OiProfiles parseProfile(const QList<DefinitionPoint>&);
            virtual void setParams(const ProductParams&);
            virtual void updateParams(ProductParams&);

        public:
            DefinitionType getDefinitionType();

        private:
            OI_DISABLE_COPY(TemplInputWidget);
            OI_DECLARE_IMPL(TemplInputWidget);
        };

        class TemplTypeStandLine :public TemplInputWidget
        {
            Q_OBJECT
        public:
            TemplTypeStandLine(DefinitionType dt, QWidget* parent = nullptr);
            ~TemplTypeStandLine();

        public:
            QList<DefinitionPoint> definitionPoints() override;
            OiProfiles parseProfile(const QList<DefinitionPoint>& dpArr) override;
            void setParams(const ProductParams& params) override;
            void updateParams(ProductParams& params) override;

        private:
            OI_DISABLE_COPY(TemplTypeStandLine);
            OI_DECLARE_IMPL(TemplTypeStandLine);
        };

        class TemplTypeReveseLie :public TemplInputWidget
        {
            Q_OBJECT
        public:
            TemplTypeReveseLie(DefinitionType dt, QWidget* parent = nullptr);
            ~TemplTypeReveseLie();

        public:
            QList<DefinitionPoint> definitionPoints() override;
            OiProfiles parseProfile(const QList<DefinitionPoint>& dpArr) override;
            void setParams(const ProductParams& params) override;
            void updateParams(ProductParams& params) override;

        private:
            OI_DISABLE_COPY(TemplTypeReveseLie);
            OI_DECLARE_IMPL(TemplTypeReveseLie);
        };

        class TemplTypeStandPart :public TemplInputWidget
        {
            Q_OBJECT
        public:
            TemplTypeStandPart(DefinitionType dt, QWidget* parent = nullptr);
            ~TemplTypeStandPart();

        public:
            QList<DefinitionPoint> definitionPoints() override;
            OiProfiles parseProfile(const QList<DefinitionPoint>& dpArr) override;
            void setParams(const ProductParams& params) override;
            void updateParams(ProductParams& params) override;

        private:
            OI_DISABLE_COPY(TemplTypeStandPart);
            OI_DECLARE_IMPL(TemplTypeStandPart);
        };

        class TemplTypeStandArcs :public TemplInputWidget
        {
            Q_OBJECT
        public:
            TemplTypeStandArcs(DefinitionType dt, QWidget* parent = nullptr);
            ~TemplTypeStandArcs();

        public:
            QList<DefinitionPoint> definitionPoints() override;
            OiProfiles parseProfile(const QList<DefinitionPoint>& dpArr) override;
            void setParams(const ProductParams& params) override;
            void updateParams(ProductParams& params) override;

        private:
            OI_DISABLE_COPY(TemplTypeStandArcs);
            OI_DECLARE_IMPL(TemplTypeStandArcs);
        };

        class TriBoardInput :public TemplInputWidget
        {
            Q_OBJECT
        public:
            TriBoardInput(DefinitionType dt, QWidget* parent = nullptr);
            ~TriBoardInput();

        public:
            QList<DefinitionPoint> definitionPoints() override;
            OiProfiles parseProfile(const QList<DefinitionPoint>& dpArr) override;
            void setParams(const ProductParams& params) override;
            void updateParams(ProductParams& params) override;

        private:
            OI_DISABLE_COPY(TriBoardInput);
            OI_DECLARE_IMPL(TriBoardInput);
        };

    }
}

#endif // !_OI_DEFINITION_TEMPL_DLG_HPP_


